﻿#include "modifyorderstate.h"
#include "ui_modifyorderstate.h"
#include <QDebug>
#include <QMessageBox>

ModifyOrderState::ModifyOrderState(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ModifyOrderState)
{
    ui->setupUi(this);
}

ModifyOrderState::~ModifyOrderState()
{
    delete ui;
}

void ModifyOrderState::setInfoShow(const QStringList& strList)
{
    if (strList.size() < 5)
    {
        return;
    }

    ui->lb_hotelName->setText(strList.at(0));
    ui->lb_checkInName->setText(strList.at(1));
    ui->lb_checkInHouseType->setText(strList.at(2));
    ui->cb_orderState->setCurrentText(strList.at(3));
    m_reserveID = strList.at(4);

    ui->pb_edit->setEnabled(false);
}


void ModifyOrderState::on_pb_cancel_clicked()
{
    this->close();
}

void ModifyOrderState::on_pb_edit_clicked()
{
    emit signalModifyOrderState(m_reserveID, m_state);
}

void ModifyOrderState::on_cb_orderState_currentIndexChanged(const QString &arg1)
{
    ui->pb_edit->setEnabled(true);
    m_state = arg1;
}

void ModifyOrderState::errorShow(const QString &msg)
{
    QMessageBox::warning(this, "警告", msg, QMessageBox::Yes , QMessageBox::Yes);
}
